# branch and loop

# 条件满足的时候执行的逻辑 if condition else 条件不满足的时候执行的逻辑


def check_age(age):
    print("抱歉,未满18岁禁止访问。") if age < 18 else print("欢迎您来～")

def min(a,b):
    return a if a < b else b

def score_level(score):
    level = (
        'D' if 0 <= score < 60 else
        'C' if 60 <= score < 80 else
        'B' if 80 <= score < 90 else
        'A' if 90 <= score < 100 else
        'S' if score == 100 else
        '请输入 0 - 100 之间的分值！'
    )
    return level


# nested branches

# 条件满足的时候执行的逻辑 if condition else 条件不满足的时候执行的逻辑

def check_access(age, isMale) :
    if age < 18 :
        return "抱歉,未满18岁禁止访问。"
    else :
        if isMale :
            return "任君选购！"
        else :
            return "抱歉,本店商品可能部适合小公举。"


if __name__ == "__main__":
    age = 19
    check_age(age)
    print(min(10, 1)) 
    print(score_level(66))
    isMale = True
    result = check_access(age, isMale)
    print(result)